<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp" %>   
<%
	String path = request.getContextPath();
	if (path.equals("/")) {
		path = "";
	}
	pageContext.setAttribute("path", path);
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>普通栏目设置</title>
	<link rel="shortcut icon" type="image/x-icon" href="${path}/favicon.ico" >
	<link rel="stylesheet" type="text/css" href="${path}/css/manage_center.css"/>    
	<script type="text/javascript" src="${path}/js/jquery/jquery-1.5.1.js"></script>
	<script type="text/javascript" src="${path}/js/jquery/jquery.corner.js"></script>
	<script type="text/javascript" src="${path}/js/jquery/jquery.form.js"></script>
	<script type="text/javascript" src="${path}/js/jquery/jquery-ui-1.8.11.custom.js"></script>
	<script type="text/javascript" src="${path}/js/formValidator/formValidator.min.js" charset="UTF-8"></script>
    <script type="text/javascript" src="${path}/js/formValidator/formValidatorRegex.js" charset="UTF-8"></script>
	<script type="text/javascript" src="${path}/ckeditor/ckeditor.js"></script>
	<script type="text/javascript" src="${path}/js/common.js"></script>
    <link type="text/css" rel="stylesheet" href="${path}/js/formValidator/style/validator.css" />
	<style type="text/css">
		require_tip {color:#f11}
          #tablea tr td.left {width: 100px;}
          #tablea tr td {}
          #tablea tr td.right {text-align: right;padding-right: 10px;width: 150px;}
        	 
	</style>
	<script type="text/javascript">
	
			//query同步get请求	
			$.ajaxSetup({   
				async : false  
			});
		    
		    $(function() {
		    	$.formValidator.initConfig(
		            {formID:"uploadForm", submitOnce:true,
		            onSuccess:function(){
		            		return true;
		            	}
		    });
		    $("#name").formValidator({onShow:"",onFocus:"",onCorrect:"　"})
		        .inputValidator({min:1,onError:"不能为空"})
		        .inputValidator({max:30,onError:"长度最多为30"});
		        
		    $("#orderNum").formValidator({onShow:"", onCorrect:"　", onFocus:""})
		        .inputValidator({min:1,onError:"不能为空"})
		        .regexValidator({regExp: "intege1",dataType:"enum", onError:"只能输入数字"});
		        
		    $("#editor").formValidator({onShow:"",onFocus:"不能为空"}).inputValidator({min:1, onError:""});
		});
		
	</script>
</head>
<body style="margin: 2, 0, 0, 13">
    <div id="right0">
         	<table class="all_table">
         		<tr class="tops">
         			<td>
         				<font size="2" style="margin-left: 15px;">
         					<s:if test="ordinaryColumn != null && ordinaryColumn.id != null">编辑普通栏目</s:if>
         					<s:else>添加普通栏目</s:else>
         				</font>
         			</td>
         		</tr>
         		<tr valign="top">
         			<td>	
				       <form method="post" id="uploadForm" name="uploadForm" enctype="multipart/form-data" action="${path}/<s:property value='url'/>">
			               <table style="margin-top: 30px;" align="center">
			                   <tr>
			                       <td width="100">
			                       		<s:if test="ordinaryColumn != null && ordinaryColumn.id != null">
											<input id="ordinaryId" type="hidden" name="ordinaryColumn.id" value="<s:property value="ordinaryColumn.id" />"/>
			                       			<input type="hidden" name="ordinaryColumn.createTime" value="<s:property value="ordinaryColumn.createTime" />"/>
										</s:if>
			                       		
			                           	栏目名称<span style="color:red;">*</span>
			                       </td>
			                       <td style="text-align: left;">
			                       		<input type="text" id="name" name="ordinaryColumn.name" value="<s:property value='ordinaryColumn.name' />"/>
			                       </td>
			                       <td><div id="nameTip"></div></td>
			                   </tr>
			                   <tr>
			                   		<td>&nbsp;&nbsp;&nbsp;排序号<span style="color:red;">*</span></td>
			                   		<td style="text-align: left;"><input type="text" id="orderNum" name="ordinaryColumn.orderNum" value="<s:property value='ordinaryColumn.orderNum' />"/></td>
			                   		<td><div id="orderNumTip"></div></td>
			                   </tr>
			                   <tr>
			                   		<td>主页显示<span style="color:red;">*</span></td>
			                   		<s:if test="ordinaryColumn != null && ordinaryColumn.id != null">
			                   			<td colspan="2" style="text-align: left;"><s:radio theme="simple" name="ordinaryColumn.homeShow" list="#request.selectHomeShow" value="ordinaryColumn.homeShow"/></td>
			                   		</s:if>
			                   		<s:else>
			                   			<td colspan="2" style="text-align: left;"><s:radio theme="simple" name="ordinaryColumn.homeShow" list="#request.selectHomeShow" value="'n'"/></td>
			                   		</s:else>
			                   </tr>
			                   <tr>
			                   		<td valign="top">
			                   			栏目内容<span style="color:red;">*</span>
			                   		</td>
			                   		<td>
			                           <textarea cols="80" id="editor" name="ordinaryColumn.content" rows="10"><s:property value="ordinaryColumn.content"/></textarea>
			                           <script type="text/javascript">
										//<![CDATA[
											CKEDITOR.replace( 'editor',
												{
													skin : 'kama'
												});
										//]]>
										</script>
			                       </td>
			                       <td><div id="editorTip"></div></td>
			                   </tr>
				                   
			                    <tr>
			                       <td colspan="3" style="height: 30px;"></td>
			                   </tr>
			                   <tr>
			                       <td colspan="3" style="text-align: center;">
			                           <input  id="submitForm" type="submit" value="保存" class="button_fy_deep"/>&nbsp;
			                           <input type="reset" value="重置" class="button_fy_deep" />&nbsp; 
			                       </td>
			                   </tr>
			               </table>
				       </form>
			      </td>
         		</tr>
         	</table>         	
        </div>
        <script type="text/javascript">
       //变成圆角 
	   becomeCorner('all_table');
	   </script>
        
    </body>
</html>